home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / system.ads < prev    next >
Text File  |  1996-01-30  |  4KB  |  98 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                               S Y S T E M                                --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.20 $                             --
  10. --                                                                          --
  11. -- This specification is adapted from the Ada Reference Manual for use with --
  12. -- GNAT.  In accordance with the copyright of that document, you can freely --
  13. -- copy and modify this specification,  provided that if you redistribute a --
  14. -- modified version,  any changes that you have made are clearly indicated. --
  15. --                                                                          --
  16. ------------------------------------------------------------------------------
  17.  
  18. --  Note: although the values in System are target dependent, the source of
  19. --  the package System itself is target independent in GNAT. This is achieved
  20. --  by using attributes for all values, including the special additional GNAT
  21. --  Standard attributes that are provided for exactly this purpose.
  22.  
  23. package System is
  24. pragma Pure (System);
  25. --  Note that we take advantage of the implementation permission to make
  26. --  this unit Pure instead of Preelaborable, see RM ???
  27.  
  28.    type Name is (GNAT);
  29.    System_Name : constant Name := GNAT;
  30.  
  31.    --  System-Dependent Named Numbers
  32.  
  33.    Min_Int                : constant := Long_Long_Integer'First;
  34.    Max_Int                : constant := Long_Long_Integer'Last;
  35.  
  36.    Max_Binary_Modulus     : constant := 2 ** Long_Long_Integer'Size;
  37.    Max_Nonbinary_Modulus  : constant := Integer'Last;
  38.  
  39.    Max_Base_Digits        : constant := Long_Long_Float'Digits;
  40.    Max_Digits             : constant := Long_Long_Float'Digits;
  41.  
  42.    Max_Mantissa           : constant := Long_Long_Integer'Size - 1;
  43.    Fine_Delta             : constant := 2.0 ** (-Max_Mantissa);
  44.  
  45.    Tick                   : constant := Standard'Tick;
  46.  
  47.    --  Storage-related Declarations
  48.  
  49.    type Address is private;
  50.    Null_Address : constant Address;
  51.  
  52.    Storage_Unit           : constant := Standard'Storage_Unit;
  53.    Word_Size              : constant := Standard'Word_Size;
  54.    Memory_Size            : constant := 2 ** Standard'Address_Size;
  55.  
  56.    --  Address comparison
  57.  
  58.    function "<"  (Left, Right : Address) return Boolean;
  59.    function "<=" (Left, Right : Address) return Boolean;
  60.    function ">"  (Left, Right : Address) return Boolean;
  61.    function ">=" (Left, Right : Address) return Boolean;
  62.    function "="  (Left, Right : Address) return Boolean;
  63.  
  64.    pragma Import (Intrinsic, "<");
  65.    pragma Import (Intrinsic, "<=");
  66.    pragma Import (Intrinsic, ">");
  67.    pragma Import (Intrinsic, ">=");
  68.    pragma Import (Intrinsic, "=");
  69.  
  70.    --  Other System-Dependent Declarations
  71.  
  72.    type Bit_Order is (High_Order_First, Low_Order_First);
  73.    Default_Bit_Order : constant Bit_Order;
  74.  
  75.    --  Priority-related Declarations (RM D.1)
  76.  
  77.    subtype Any_Priority is Integer
  78.      range 0 .. Standard'Max_Interrupt_Priority;
  79.  
  80.    subtype Priority is Any_Priority
  81.      range 0 .. Standard'Max_Priority;
  82.  
  83.    subtype Interrupt_Priority is Any_Priority
  84.      range Standard'Max_Priority + 1 .. Standard'Max_Interrupt_Priority;
  85.  
  86.    Default_Priority : constant Priority :=
  87.      (Priority'First + Priority'Last) / 2;
  88.  
  89. private
  90.  
  91.    type Address is mod Memory_Size;
  92.    Null_Address : constant Address := 0;
  93.  
  94.    Default_Bit_Order : constant Bit_Order := Low_Order_First;
  95.    --  To be fixed when the attribute is implemented ???
  96.  
  97. end System;
  98.